import axios from '../axios'
export default class message {
  static async MyGetInfoListForMessage(params) { //推送对象的小区tree数据
    let res = await axios.post('/business/residentialQuarters/getInfoListForMessage', params)
    return res.data
  }
  static async MyGetAgencyListForMessage(unitId, name,unitType) { //推送对象的机关tree数据
    let res = await axios.get(`/business/agency/getAgencyListForMessage?unitId=${unitId}&name=${name}&unitType=${unitType}`)
    return res.data
  }
  static async MyGetCompanyListForMessage(unitId, name,unitType) { //推送对象的机构tree数据
    let res = await axios.get(`/business/company/getCompanyListForMessage?unitId=${unitId}&name=${name}&unitType=${unitType}`)
    return res.data
  }
  static async MywebMessagelist(params) { //Web消息列表
    let res = await axios.post('/notice/webMessage/list', params)
    return res.data
  }
  static async MysummaryList(params) { //Web消息列表铃铛
    let res = await axios.post('/notice/webMessage/summaryList', params)
    return res.data
  }
  static async MywebMessageread(params) { //web端消息已读接口
    let res = await axios.post('/notice/webMessage/read', params)
    return res.data
  }

  static async MygetUserListByParams(params) { //推送给个人列表
    let res = await axios.post('/business/notice/getUserListByParams', params)
    return res.data
  }
  static async MygetOrganizationByParams(params) { //推送给组织列表
    let res = await axios.post('/business/notice/getOrganizationByParams', params)
    return res.data
  }
  static async MygetDepartment(params) { //通过机构id获取机构部门列表
    let res = await axios.post('/auth/department/getDepartmentListByUnit', params)
    return res.data
  }
  static async MygetItemList(type, id) { //通过机构id获取部门列表
    let res = await axios.get(`/business/notice/getItemList?type=${type}&id=${id}`)
    return res.data
  }

  static async MydeleteImg(params) { //公告删除图片
    let res = await axios.post(`/business/notice/deleteImg`, params)
    return res.data
  }
  static async MyindeleteImg(params) { //资讯删除图片
    let res = await axios.post(`/business/information/deleteImg`, params)
    return res.data
  }

  static async MygetPushRangeList() { //获取所有选择的小区、楼宇、房间信息
    let res = await axios.post(`/business/notice/getPushRangeList`,
      {
        "type": "residential",
        "id": 0, //id,查所有则为0
        "name": "" //根据小区名查询
      }
    )
    return res.data
  }
  static async MygetNoticeList(params) { //公告列表
    let res = await axios.post(`/business/notice/getNoticeList`, params)
    return res.data
  }
  static async MygetNoticeDetail(id) { //公告详情
    let res = await axios.get(`/business/notice/getNoticeDetail?id=${id}`)
    return res.data
  }
  static async MyinsertNotice(params) { //公告新增
    let res = await axios.post(`/business/notice/insertNotice`, params)
    return res.data
  }
  static async MyupdateNotice(params) { //公告修改
    let res = await axios.post(`/business/notice/updateNotice`, params)
    return res.data
  }
  static async MysubmitApproval(params) { //公告发布  也叫提交审批
    let res = await axios.post(`/business/noticeApproval/submitApproval`, params)
    return res.data
  }
  static async MydeleteNotice(params) { //公告删除
    let res = await axios.post(`/business/notice/deleteNotice`, params)
    return res.data
  }
  //////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////
  static async MygetInformationList(params) { //资讯列表
    let res = await axios.post(`/business/information/getInformationList`, params)
    return res.data
  }
  static async MygetInformationDetail(id) { //资讯详情
    let res = await axios.get(`/business/information/getInformationDetail?id=${id}`)
    return res.data
  }
  static async MyinsertInformation(params) { //资讯新增
    let res = await axios.post(`/business/information/insertInformation`, params)
    return res.data
  }
  static async MyinupdateInformation(params) { //资讯修改
    let res = await axios.post(`/business/information/updateInformation`, params)
    return res.data
  }
  static async MyinsubmitApproval(params) { //资讯发布按钮  也叫提交审批
    let res = await axios.post(`/business/informationApproval/submitApproval`, params)
    return res.data
  }
  static async MyindeleteNotice(params) { //资讯删除
    let res = await axios.post(`/business/information/deleteInformation`, params)
    return res.data
  }



  static async MyapprovalList(params) { //公告审批列表
    let res = await axios.post(`/business/noticeApproval/approvalList`, params)
    return res.data
  }
  static async MyapprovalDetail(id) { //公告审批详情
    let res = await axios.get(`/business/noticeApproval/approvalDetail?id=${id}`)
    return res.data
  }
  static async Myapproval(params) { //公告审批
    let res = await axios.post(`/business/noticeApproval/approval`, params)
    return res.data
  }
  static async MygetPushObjectsList(params) { //公告审批详情推送人群列表
    let res = await axios.post(`/business/noticeApproval/getPushObjectsList`, params)
    return res.data
  }

  static async MyinsertSeal(params) { //新增印章
    let res = await axios.post(`/business/seal/insertSeal`, params)
    return res.data
  }
  static async MyupdateSeal(params) { //修改印章
    let res = await axios.post(`/business/seal/updateSeal`, params)
    return res.data
  }
  static async MygetSealDetail(params) { //获取登录人的印章详情
    let res = await axios.post(`/business/seal/getSealDetail`, params)
    return res.data
  }

  static async MyinapprovalList(params) { //资讯审批列表
    let res = await axios.post(`/business/informationApproval/approvalList`, params)
    return res.data
  }
  static async MyinapprovalDetail(id) { //资讯审批详情
    let res = await axios.get(`/business/informationApproval/approvalDetail?id=${id}`)
    return res.data
  }
  static async MyingetPushObjectsList(params) { //资讯审批详情推送人群列表
    let res = await axios.post(`/business/informationApproval/getPushObjectsList`, params)
    return res.data
  }
  static async Myinapproval(params) { //资讯审批
    let res = await axios.post(`/business/informationApproval/approval`, params)
    return res.data
  }

  static async MycheckUser(params) { //判断是否超级管理员
    let res = await axios.post(`/business/seal/checkUser`, params)
    return res.data
  }
  static async mygetUserMainDepartment() { //获取登录用户主部门
    let res = await axios.get(`/business/notice/getUserMainDepartment`)
    return res.data
  }

  static async myInvoiceAdd(params) { //发票新增
    let res = await axios.post(`/business/invoice/insert`, params)
    return res.data
  }
  static async myInvoiceList(params) { //发票列表
    let res = await axios.post(`/business/invoice/list`, params)
    return res.data
  }
  static async myInvoiceDetail(id) { //发票详情
    let res = await axios.get(`/business/invoice/detail?id=${id}`)
    return res.data
  }
  static async myupdateInvoice(params) { //发票修改
    let res = await axios.post(`/business/invoice/updateInvoice`, params)
    return res.data
  }
  static async mydeleteLogice(id) { //发票删除
    let res = await axios.get(`/business/invoice/deleteLogic?id=${id}`)
    return res.data
  }
}